import request from '@/utils/request';


// 城市列表
export function cityList(data) {
    return request({ url: '/admin/platform/base-city/list', method: 'get', params: data })
}

// 城市详情
export function cityDetailApi(id) {
    return request({ url: `/admin/platform/base-city/info`, method: 'get' ,params:{id:id}})
}

// 城市显示/隐藏
export function setCityShowApi(data) {
    return request({ url: `/admin/platform/base-city/set_show`, method: 'PUT' ,params:{
        id:data.id,
        status:data.status,
    }})
}

//编辑城市
export function citySaveApi(data){
    return request({url: '/admin/platform/base-city/save',method:'post',data})
}

//删除城市
export function cityDelApi(id){
    return request({url:'/admin/platform/base-city/delete',method:'get',params:{id}})
}

//获取门店列表
export function getCompanyListApi(data){
    return request({ url: '/admin/platform/base-company/list', method: 'get', params: data })
}

//获取门店详情
export function getCompanyFromDataApi(data){
    return request({ url: '/admin/platform/base-company/info', method: 'get', params: data })
}

//保存门店信息
export function saveCompanyApi(data){
    return request({ url: '/admin/platform/base-company/save', method: 'post',  data })
}

//设置门店状态
export function setCompanyStatusApi(data){
    return request({ url: '/admin/platform/base-company/set_show', method: 'put', params: data })
}

//禁用门店
export function setCompanyDisableApi(data){
    return request({url: `/admin/platform/base-company/set_disable`,method:'PUT',params:data});
}

//删除门店
export function companyDelApi(id){
    return request({url:`/admin/platform/base-company/delete`,method:'get',params:{id}})
}

//
export function getCompanyRelateListApi(data){
    return request({url:'/admin/platform/base-company-relate/list',method: 'get', params:data})
}

export function baseCompanyRelateSaveApi(data){
    return request({url:'/admin/platform/base-company-relate/save',method:'post',data})
}

//删除开通分类
export function baseCompanyRelatedelApi(data){
    return request({url:'/admin/platform/base-company-relate/delete',method:'get',params:data})
}

// 服务人员列表
export function getStaffListApi (data) {
    return request({ url: '/admin/platform/service-staff/list', method: 'get', params: data })
}

// 获取服务人员详细信息
export function getStaffFromDataApi (data) {
    return request({ url: '/admin/platform/service-staff/info', method: 'get', params: data })
}


//禁用服务人员
export function setStaffDisableApi(data){
    return request({url: `/admin/platform/service-staff/set_disable`,method:'put',params:data});
}

//删除服务人员
export function staffDelApi(id){
    return request({url:'/admin/platform/service-staff/delete',method:'get',params:{id}})
}

//服务人员信息保存
export function saveStaffApi(data){
    return request({url:'/admin/platform/service-staff/save',method:'post',data})
}

//服务人员开通服务项目列表
export function getStaffRelateApi(data){
    return request({url:'/admin/platform/service-staff-relate/get_staff_relate',method:'get',params:data})
}

//服务人员关联服务项目
export function saveStaffRelate(data){
    return request({url:'/admin/platform/service-staff-relate/save_staff_relate',method:'post',data});
}

// 人员-申请列表
export function getStaffApplyListApi (data) {
    return request({ url: '/admin/platform/base-staff-apply/list', method: 'get', params: data })
}

// 人员-申请详情
export function getStaffApplyFromDataApi (data) {
    return request({ url: '/admin/platform/base-staff-apply/info', method: 'get', params: data })
}

// 人员-审批提交
export function saveStaffApplyApi (data) {
    return request({ url: '/admin/platform/base-staff-apply/staff_save_apply', method: 'post', data })
}

// 门店-申请列表
export function getCompanyApplyListApi (data) {
    return request({ url: '/admin/platform/base-company-apply/list', method: 'get', params: data })
}

// 门店-申请详情
export function getCompanyApplyFromDataApi (data) {
    return request({ url: '/admin/platform/base-company-apply/info', method: 'get', params: data })
}

// 门店-审批提交
export function saveCompanyApplyApi (data) {
    return request({ url: '/admin/platform/base-company-apply/save_apply', method: 'post', data })
}

//---------------------门店提现审核START---------------------------
/**
 * 获取申请列表
 * @param {*} params 
 * @returns 
 */
export function companyExtractListApi(params){
    return request({
        url:'/admin/platform/service-company-extract/index',
        method:'get',
        params
    })
}


/**
 * 提现申请通过
 * @param {*} id 
 * @returns 
 */
export function companyExtractAdoptApi(id){
    return request({
        url:'/admin/platform/service-company-extract/adopt',
        method:'post',
        data:{id}
    })
}

/**
 * 驳回申请
 * @param {*} data 
 * @returns 
 */
export function companyExtractRefuseApi(data){
    return request({
        url:'/admin/platform/service-company-extract/refuse',
        method:'post',
        data
    })
}

//---------------------门店提现审核START---------------------------

//---------------------上门分销start-------------------------

//分销管理员列表
export function promoterListApi(params){
    return request({
        url: '/admin/platform/services/user/index',
        method: 'get',
        params,
      });
}

//推广人列表
export function spreadListApi(params) {
    return request({
      url: '/admin/platform/services/user/stair',
      method: 'get',
      params,
    });
  }


  //推广订单查询
export function spreadOrderListApi(params){
    return request({
        url: '/admin/platform/services/user/stair_order',
        method: 'get',
        params,
      });
}

//----------------上门分销END----------------------------

//--------------------代理维护START------------------------

//获取代理列表
export function baseAgentList(params){
    return request({
        url:'/admin/platform/base-agent/list',
        method:'get',
        params
    })
}

//获取代理详情
export function getAgentFromDataApi(id){
    return request({
        url:'/admin/platform/base-agent/info',
        method:'get',
        params:{id}
    })
}

//保存代理信息
export function saveAgentApi(data){
    return request({
        url:'/admin/platform/base-agent/save',
        method:'post',
        data
    })
}

//删除代理
export function delAgentApi(id){
    return request({
        url:'/admin/platform/base-agent/delete',
        method:'get',
        params:{id}
    })
}

//删除代理
export function setAgentStataus(data){
    return request({
        url:'/admin/platform/base-agent/set_show',
        method:'put',
        params:data
    })
}

//----------------代理维护END----------------

//----------------代理提现审核START----------------

//提现列表
export function getAgentExtractListApi(params){
    return request({
        url:'/admin/platform/service-agent-extract/index',
        method:'get',
        params
    })
}

//提现审核通过
export function agentExtractAdoptApi(data){
    return request({
        url:'/admin/platform/service-agent-extract/adopt',
        method:'post',
        data
    })
}

//提现审核驳回
export function agentExtractRefuseApi(data){
    return request({
        url:'/admin/platform/service-agent-extract/refuse',
        method:'post',
        data
    })
}

//----------------代理提现审核END----------------